package designPattern.action11.command.c4t3;

import designPattern.action11.command.c4t3.concrete.command.ConcreteCommand;
import designPattern.action11.command.c4t3.tools.MakeDir;
import designPattern.action11.command.c4t3.sketch.Command;
import designPattern.action11.command.c4t3.sketch.RequestMakedir;
/*
命令模式
本例子：
支持撤销命令

 */
public class Application {
    public static void main(String args[]) {
        MakeDir makeDir = new MakeDir();
        Command command = new ConcreteCommand(makeDir);
        RequestMakedir askMakedir = new RequestMakedir();
        askMakedir.setCommand(command);
        askMakedir.startExecuteCommand("jiafei");
        askMakedir.startExecuteCommand("jerry");
        askMakedir.startExecuteCommand("tom");
        askMakedir.undoCommand();
        askMakedir.undoCommand();
    }
}
